package com.yk.faceapplication.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.allinpay.xed.R;

/**
 * Created by yk_2018/1/19_16:02
 */

public class SettingActivity extends BaseActivity{
    private TextView aboutTV;
    private TextView cleanTV;
    private TextView commitTV;

    private Button commitBtn;

    @Override
    protected void onCreate(Bundle arg0) {
        // TODO Auto-generated method stub
        super.onCreate(arg0);
        setTitle("设置");
        aboutTV = (TextView) findViewById(R.id.about_tv);
        aboutTV.setOnClickListener(this);
        cleanTV = (TextView) findViewById(R.id.clean_tv);
        cleanTV.setOnClickListener(this);
        commitTV = (TextView) findViewById(R.id.commit_tv);
        commitTV.setOnClickListener(this);

        commitBtn = (Button) findViewById(R.id.commit_btn);
        commitBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        super.onClick(v);
        if (v.getId() == R.id.about_tv) {
//            Intent intent = new Intent(SettingActivity.this, AboutActivity.class);
//            intent.putExtra("title", "关于我们");
//            startActivity(intent);
            Intent intent = new Intent(SettingActivity.this, WebviewActivity.class);
            intent.putExtra("url", "http:\\/\\/www.allinpay.com\\/");
            startActivity(intent);
        }
        else if (v.getId() == R.id.clean_tv) {
            Toast.makeText(mApplication, "缓存清除成功", Toast.LENGTH_SHORT).show();
        }
        else if (v.getId() == R.id.commit_tv) {
            startActivity(new Intent(SettingActivity.this, CommitActivity.class));
        }
        else if (v.getId() == R.id.commit_btn) {
            Toast.makeText(mApplication, "注销成功", Toast.LENGTH_SHORT).show();
            editor.remove("phone").commit();
            editor.remove("token").commit();
            editor.remove("pwd").commit();
            setResult(RESULT_OK);
            finishAct();
        }
    }

    private void getCustomerService() {

    }
}
